<template>
  <div class="roomlist">
    <RoomNotice :notice="notice"/>
    <el-divider></el-divider>
    <div class="room-item w">
      <ul v-if="roomList.length !== 0">
        <li v-for="(item,index) in roomList" :key="index">
          <room-list-item :rooms-item="item"/>
        </li>
      </ul>
      <h3 v-else>暂无数据</h3>
    </div>
  </div>
</template>
<script>
import RoomNotice from "@/components/conment/rooms/RoomNotice";
import RoomListItem from "@/components/conment/rooms/RoomListItem";
import { getAllSimpleRoomType} from "@/network/common";

export default {
  name: "Room",
  components: {RoomListItem,  RoomNotice},
  data(){
    return{
      roomList:[],
    }
  },
  props:{
    notice:[],
  },
  created() {
    getAllSimpleRoomType().then(res=>{
      this.roomList = res.data.data
    })
  }
}
</script>

<style scoped>
  .w {
    width: 1200px;
    margin: 0 auto;
  }
  li {
    list-style: none;/*去除原点*/
  }
  a {
    text-decoration: none;
  }
  h3 {
    text-align: center;
  }
  .room-item ul {
    margin: 0 auto;
    padding: 0;
  }
</style>